﻿//
// *************************************************************************************
// WP-Framework
// 
// Developed by
// Lukas Kretschmar (lkretschmar.dev@bluewin.ch)
//
// Switzerland, Copyright (c) 2013 lkretschmar
// This content is released under the MIT License (http://opensource.org/licenses/MIT).
//     
// *************************************************************************************
//
//
			

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace KretschIT.WP_Fx.EasyMoq.Generator.Tests
{
    [TestClass]
    public class AssemblyResolverTest
    {
        private IAssemblyResolver resolver;

        [TestInitialize]
        public void Init()
        {
            this.resolver = new AssemblyResolver();
        }

        [TestMethod]
        public void Test_Resolve_InvalidArguments()
        {
            var assembly = this.resolver.GetAssembly(null, null);
            Assert.IsNull(assembly);

            assembly = this.resolver.GetAssembly(null, AppDomain.CurrentDomain.GetAssemblies());
            Assert.IsNull(assembly);

            assembly = this.resolver.GetAssembly(string.Empty, null);
            Assert.IsNull(assembly);

            assembly = this.resolver.GetAssembly(string.Empty, AppDomain.CurrentDomain.GetAssemblies());
            Assert.IsNull(assembly);
        }

        [TestMethod]
        public void Test_Resolve()
        {
            var assembly = this.resolver.GetAssembly("WP-Fx.EasyMoq.Generator.Tests", AppDomain.CurrentDomain.GetAssemblies());
            Assert.IsNotNull(assembly);
        }
    }
}
